const express = require('express')
const router = express.Router()
const student = require('../controller/home/student');


// 学生的登录

router.get('/student', student.list);
router.post('/student', student.add);
router.get('/student/:id', student.detail);
router.put('/student/:id', student.update);
router.delete('/student/:id', student.delete);

router.get('/test', function(req, res){
    res.send({name: '看我帅不帅'});
})





/** 
 * 
 * restful 风格的URL
 * http://127.0.0.1/user/1
 * GET : 读取资源
 * DELETE:删除这个资源
 * PUT: 修改资源信息
 * 
 * http://127.0.0.1/user
 * POST: 创建资源
 * GET: 获取资源列表
 * 
 */


module.exports = router;